/***
 * Create TreeView
 */
import groovy.xml.MarkupBuilder

class ManagerController {

    def index = {
        redirect(action: build)
    }

    def build = {
        def writer = new StringWriter()
        def xml = new MarkupBuilder(writer)
        
    	xml.name(name: "Grenoble"){
    	    name(name: "Books"){
    	     name(name:"Book 1")
                //Optional id
    		name(name:"Book 2", id: 1)
    	    }
    	}

        if(!params.max)params.max = 10
        [ view: "treeview", "data": writer.toString(), paquetList: paquet.list( params )]
    }
}
